home *** CD-ROM | disk | FTP | other *** search
/ Network PC / Network PC.iso / amiga utilities / communication / internet / amitcp3.0b / src.lha / src / amitcp / api / apicalls_sasc.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-09-08  |  3.8 KB  |  162 lines

  1. #ifndef API_APICALLS_SASC_H
  2. #define API_APICALLS_SASC_H
  3.  
  4. #ifndef API_APICALLS_H
  5. #error include <api/apicalls.h> instead of <api/apicalls_sasc.h>
  6. #endif
  7.  
  8. #ifndef EXEC_TYPES_H
  9. #include <exec/types.h>
  10. #endif
  11.  
  12. #ifndef SYS_TYPES_H
  13. #include <sys/types.h>
  14. #endif
  15.  
  16. #ifndef SYS_TIME_H
  17. #include <sys/time.h>
  18. #endif
  19.  
  20. #include <stdarg.h>
  21.  
  22. #if 0
  23. #ifndef SYS_SOCKET_H
  24. #include <sys/socket.h>
  25. #endif
  26.  
  27. #ifndef IN_H
  28. #include <netinet/in.h>
  29. #endif
  30. #endif
  31.  
  32.  
  33.  
  34. extern REGARGFUN LONG _CloseSocket(register __a6 struct SocketBase *,
  35.                    register __d0 LONG);
  36.  
  37. extern REGARGFUN LONG _connect(register __a6 struct SocketBase *,
  38.                    register __d0 LONG,
  39.                    register __a0 struct sockaddr *,
  40.                    register __d1 LONG);
  41.  
  42. extern REGARGFUN LONG _recv(register __a6 struct SocketBase *,
  43.                 register __d0 LONG,
  44.                 register __a0 char *,
  45.                 register __d1 LONG,
  46.                 register __d2 LONG);
  47.  
  48. extern REGARGFUN LONG _send(register __a6 struct SocketBase *,
  49.                 register __d0 LONG,
  50.                 register __a0 char *,
  51.                 register __d1 LONG,
  52.                 register __d2 LONG);
  53.  
  54. extern REGARGFUN LONG _sendto(register __a6 struct SocketBase *,
  55.                   register __d0 LONG,
  56.                   register __a0 char *,
  57.                   register __d1 LONG,
  58.                   register __d2 LONG,
  59.                   register __a1 struct sockaddr *,
  60.                   register __d3 LONG);
  61.  
  62. extern REGARGFUN LONG _socket(register __a6 struct SocketBase *,
  63.                   register __d0 LONG,
  64.                   register __d1 LONG,
  65.                   register __d2 LONG);
  66.  
  67.  
  68. extern REGARGFUN LONG _WaitSelect(register __a6 struct SocketBase *,
  69.                   register __d0 ULONG,
  70.                   register __a0 fd_set *,
  71.                   register __a1 fd_set *,
  72.                   register __a2 fd_set *,
  73.                   register __a3    struct timeval *,
  74.                   register __d1 ULONG *);
  75.  
  76.  
  77. extern REGARGFUN 
  78.   struct hostent * _gethostbyaddr(register __a6 struct SocketBase *,
  79.                   register __a0 const UBYTE *,
  80.                   register __d0 int,
  81.                   register __d1 int);
  82.  
  83. extern REGARGFUN LONG _gethostname(register __a6 struct SocketBase *,
  84.                    register __a0 STRPTR,
  85.                    register __d0 LONG);
  86.  
  87. extern REGARGFUN LONG _SetErrnoPtr(register __a6 struct SocketBase *,
  88.                    register __a0 VOID *,
  89.                    register __d0 UBYTE);
  90.  
  91. #define BASE_EXT_DECL
  92. #define BASE_PAR_DECL  struct SocketBase * SocketBase,
  93. #define BASE_PAR_DECL0 struct SocketBase * SocketBase
  94. #define BASE_NAME SocketBase  
  95.  
  96. static __inline LONG 
  97. CloseSocket (BASE_PAR_DECL LONG d)
  98. {
  99.   return _CloseSocket(SocketBase, d);
  100. }
  101.  
  102. static __inline LONG 
  103. connect (BASE_PAR_DECL LONG s,struct sockaddr * name,LONG  namelen)
  104. {
  105.   return _connect(SocketBase, s, name, namelen);
  106. }
  107.  
  108. static __inline LONG 
  109. recv (BASE_PAR_DECL LONG s,char * buf,LONG  len,LONG  flags)
  110. {
  111.   return _recv(SocketBase, s, buf, len, flags);
  112. }
  113.  
  114. static __inline LONG 
  115. send (BASE_PAR_DECL LONG s,char * msg,LONG  len,LONG  flags)
  116. {
  117.   return _send(SocketBase, s, msg, len, flags);
  118. }
  119.  
  120. static __inline LONG 
  121. sendto (BASE_PAR_DECL LONG s,char * msg,LONG  len,LONG  flags,struct sockaddr * to,LONG  tolen)
  122. {
  123.   return _sendto(SocketBase, s, msg, len, flags, to, tolen);
  124. }
  125.  
  126. static __inline LONG 
  127. socket (BASE_PAR_DECL LONG domain,LONG  type,LONG  protocol)
  128. {
  129.   return _socket(SocketBase, domain, type, protocol);
  130. }
  131.  
  132. static __inline LONG 
  133. WaitSelect (BASE_PAR_DECL LONG nfds,fd_set * readfds,fd_set * writefds,fd_set * execptfds,struct timeval * timeout,ULONG * maskp)
  134. {
  135.   return _WaitSelect(SocketBase, nfds, readfds, writefds, execptfds, timeout, maskp);
  136. }
  137.  
  138. static struct hostent * __inline 
  139. gethostbyaddr (BASE_PAR_DECL const UBYTE * addr, int len, int type)
  140. {
  141.   return _gethostbyaddr(BASE_NAME, addr, len, type);
  142. }
  143.  
  144. static LONG __inline
  145. gethostname(BASE_PAR_DECL STRPTR name, LONG namelen)
  146. {
  147.   return _gethostname(BASE_NAME, name, namelen);
  148. }
  149.  
  150. static LONG __inline
  151. SetErrnoPtr(BASE_PAR_DECL VOID * err_p, UBYTE size)
  152. {
  153.   return _SetErrnoPtr(BASE_NAME, err_p, size);
  154. }
  155.  
  156. #undef BASE_EXT_DECL
  157. #undef BASE_PAR_DECL
  158. #undef BASE_PAR_DECL0
  159. #undef BASE_NAME
  160.  
  161. #endif /* API_APICALLS_SASC_H */
  162.